package com.woniu.adopt.mapper;

import com.woniu.adopt.entity.Comment;
import com.woniu.adopt.vo.CommentVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CommentMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(Comment record);

    Comment selectByPrimaryKey(Integer id);


    List<Comment> selectAll();

    int updateByPrimaryKey(Comment record);

    List<CommentVo> selectAllByDel(@Param("username") String uname, @Param("petName") String pname);

    CommentVo selectCommentByKey(Integer id);

    void updateCommentByKey(CommentVo commentVo);

    @Update("UPDATE t_comment set del = -1  where id = #{id}")
    int updateCommentByDel(int id);
}